<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>UDT Reference</title>
</head>

<body>

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="table3" bgcolor="#99CCFF" bordercolor="#99CCFF">
  <tr>
    <td width="100%"><font face="Verdana" size="2"><i>&nbsp;UDT Reference: UDT 
	Functions</i></font></td>
  </tr>
</table>
<h1><font face="Verdana" size="4">socket</font></h1>
<p><font face="Verdana" size="2">The <b>socket</b> method creates a new UDT 
socket.</font></p>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="table4" bgcolor="#C0C0C0" bordercolor="#C0C0C0">
  <tr>
    <td width="100%">
	<p style="margin-top: 0; margin-bottom: 0">
    <font size="1" face="Courier New">UDTSOCKET socket(<br>
&nbsp; int <font color="#FFFFFF">af</font>,<br>
&nbsp; int <font color="#FFFFFF">type</font> = 0,<br>
&nbsp; int <font color="#FFFFFF">protocol </font>= 0<br>
	);</font></p></td>
  </tr>
</table>
<h4><font face="Verdana" size="2">Parameters</font></h4>
<dl>
	<dt><font size="2" face="Verdana">
	<i>af</i>
	</font> </dt>
	<dd><font face="Verdana" size="2">[in] IP family. </font></dd>
	<dt><i><font face="Verdana" size="2">type</font></i><font size="2" face="Verdana">
	</font> </dt>
	<dd><font face="Verdana" size="2">[in] Ignored. Type of connection. </font></dd>
	<dt><font size="2" face="Verdana">
	<i>protocol</i>
	</font> </dt>
	<dd><font face="Verdana" size="2">[in] Ignored. Protocol to be used. </font> </dd>
</dl>
<h4><font face="Verdana" size="2">Return Values</font></h4>
<p><font face="Verdana" size="2">If no error occurs, <b>socket</b> returns a new 
UDT socket descriptor; otherwise, it returns UDT::INVALID_SOCK and the specific 
error information can be retrieved using <a href="error.htm">getlasterror</a>. </font></p>
  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="table5" bordercolordark="#C0C0C0" bordercolorlight="#C0C0C0" width="100%">
    <tr>
      <th align="center" bgcolor="#C0C0C0" width="133">
		<font face="Verdana" size="2">Error Code</font></th>
      <th align="center" bgcolor="#C0C0C0" width="812"><b>
      <font face="Verdana" size="2">Comment</font></b></th>
    </tr>
    <tr>
      <td width="133">
      <p style="margin-top: 1; margin-bottom: 1"><font face="Verdana" size="1">
		5003</font></td>
      <td width="812">
      <p style="margin-top: 1; margin-bottom: 1"><font face="Verdana" size="1">
		invalid parameters.</font></td>
    </tr>
    </table>
<H4><font face="Verdana" size="2">Descriptions</font></H4>
<p><font face="Verdana" size="2">The socket method is used to create a new UDT 
socket. The last two parameters is only used for compatibility with traditional 
socket API.</font></p>
<P>
<p></p>
<H4><font face="Verdana" size="2">See Also</font></H4>
<P><b><font face="Verdana" size="2"><a href="close.htm">close</a></font></b></P>

</body>

</html>